import prompt from '@system.prompt';
export default {
    data: {
        title: 'World'
    },
    showActionMenu(){
        prompt.showActionMenu({
            title: 'Title Info',
            buttons: [
                {
                    text: 'item1',
                    color: '#666666',
                },
                {
                    text: 'item2',
                    color: '#000000',
                },
            ],
            success: function(data) {
                console.log('dialog success callback，click button : ' + data.tapIndex);
            },
            fail: function(data) {
                console.log('dialog fail callback' + data.errMsg);
            },
        });
    },
    showDialog(){
        prompt.showDialog({
            title: 'Title Info',
            message: 'Message Info',
            buttons: [
                {
                    text: '确认',
                    color: 'green',
                },
                {
                    text: '取消',
                    color: '#666666',
                },
            ],
            success: function(data) {
                console.log('dialog success callback，click button : ' + data.index);
            },
            cancel: function() {
                console.log('dialog cancel callback');
            },
        });
    },
    showToast(){
        prompt.showToast({
            message: 'Message Info',
            duration: 2000,
        });
    },
}
